Optimal. Leaf size=120 \[ \frac {b f (d e-c f) x}{d^2}+\frac {b f^2 (c+d x)^2}{6 d^3}+\frac {(e+f x)^3 \left (a+b \tanh ^{-1}(c+d x)\right )}{3 f}+\frac {b (d e+f-c f)^3 \log (1-c-d x)}{6 d^3 f}-\frac {b (d e-(1+c) f)^3 \log (1+c+d x)}{6 d^3 f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.15, antiderivative size = 120, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 5, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.278, Rules used = {6246, 6063,
716, 647, 31} \begin {gather*} \frac {(e+f x)^3 \left (a+b \tanh ^{-1}(c+d x)\right )}{3 f}+\frac {b (-c f+d e+f)^3 \log (-c-d x+1)}{6 d^3 f}-\frac {b (d e-(c+1) f)^3 \log (c+d x+1)}{6 d^3 f}+\frac {b f^2 (c+d x)^2}{6 d^3}+\frac {b f x (d e-c f)}{d^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 31
Rule 647
Rule 716
Rule 6063
Rule 6246
Rubi steps
\begin {align*} \int (e+f x)^2 \left (a+b \tanh ^{-1}(c+d x)\right ) \, dx &=\frac {\text {Subst}\left (\int \left (\frac {d e-c f}{d}+\frac {f x}{d}\right )^2 \left (a+b \tanh ^{-1}(x)\right ) \, dx,x,c+d x\right )}{d}\\ &=\frac {(e+f x)^3 \left (a+b \tanh ^{-1}(c+d x)\right )}{3 f}-\frac {b \text {Subst}\left (\int \frac {\left (\frac {d e-c f}{d}+\frac {f x}{d}\right )^3}{1-x^2} \, dx,x,c+d x\right )}{3 f}\\ &=\frac {(e+f x)^3 \left (a+b \tanh ^{-1}(c+d x)\right )}{3 f}-\frac {b \text {Subst}\left (\int \left (-\frac {3 f^2 (d e-c f)}{d^3}-\frac {f^3 x}{d^3}+\frac {(d e-c f) \left (d^2 e^2-2 c d e f+3 f^2+c^2 f^2\right )+f \left (3 d^2 e^2-6 c d e f+\left (1+3 c^2\right ) f^2\right ) x}{d^3 \left (1-x^2\right )}\right ) \, dx,x,c+d x\right )}{3 f}\\ &=\frac {b f (d e-c f) x}{d^2}+\frac {b f^2 (c+d x)^2}{6 d^3}+\frac {(e+f x)^3 \left (a+b \tanh ^{-1}(c+d x)\right )}{3 f}-\frac {b \text {Subst}\left (\int \frac {(d e-c f) \left (d^2 e^2-2 c d e f+3 f^2+c^2 f^2\right )+f \left (3 d^2 e^2-6 c d e f+\left (1+3 c^2\right ) f^2\right ) x}{1-x^2} \, dx,x,c+d x\right )}{3 d^3 f}\\ &=\frac {b f (d e-c f) x}{d^2}+\frac {b f^2 (c+d x)^2}{6 d^3}+\frac {(e+f x)^3 \left (a+b \tanh ^{-1}(c+d x)\right )}{3 f}-\frac {\left (b (d e+f-c f)^3\right ) \text {Subst}\left (\int \frac {1}{1-x} \, dx,x,c+d x\right )}{6 d^3 f}+\frac {\left (b (d e-(1+c) f)^3\right ) \text {Subst}\left (\int \frac {1}{-1-x} \, dx,x,c+d x\right )}{6 d^3 f}\\ &=\frac {b f (d e-c f) x}{d^2}+\frac {b f^2 (c+d x)^2}{6 d^3}+\frac {(e+f x)^3 \left (a+b \tanh ^{-1}(c+d x)\right )}{3 f}+\frac {b (d e+f-c f)^3 \log (1-c-d x)}{6 d^3 f}-\frac {b (d e-(1+c) f)^3 \log (1+c+d x)}{6 d^3 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.12, size = 174, normalized size = 1.45 \begin {gather*} \frac {2 d \left (3 a d^2 e^2+b f (3 d e-2 c f)\right ) x+d^2 f (6 a d e+b f) x^2+2 a d^3 f^2 x^3+2 b d^3 x \left (3 e^2+3 e f x+f^2 x^2\right ) \tanh ^{-1}(c+d x)-b (-1+c) \left (3 d^2 e^2-3 (-1+c) d e f+(-1+c)^2 f^2\right ) \log (1-c-d x)+b (1+c) \left (3 d^2 e^2-3 (1+c) d e f+(1+c)^2 f^2\right ) \log (1+c+d x)}{6 d^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(589\) vs.
\(2(112)=224\).
time = 0.70, size = 590, normalized size = 4.92 Too large to display
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.26, size = 207, normalized size = 1.72 \begin {gather*} \frac {1}{3} \, a f^{2} x^{3} + a f x^{2} e + \frac {1}{6} \, {\left (2 \, x^{3} \operatorname {artanh}\left (d x + c\right ) + d {\left (\frac {d x^{2} - 4 \, c x}{d^{3}} + \frac {{\left (c^{3} + 3 \, c^{2} + 3 \, c + 1\right )} \log \left (d x + c + 1\right )}{d^{4}} - \frac {{\left (c^{3} - 3 \, c^{2} + 3 \, c - 1\right )} \log \left (d x + c - 1\right )}{d^{4}}\right )}\right )} b f^{2} + \frac {1}{2} \, {\left (2 \, x^{2} \operatorname {artanh}\left (d x + c\right ) + d {\left (\frac {2 \, x}{d^{2}} - \frac {{\left (c^{2} + 2 \, c + 1\right )} \log \left (d x + c + 1\right )}{d^{3}} + \frac {{\left (c^{2} - 2 \, c + 1\right )} \log \left (d x + c - 1\right )}{d^{3}}\right )}\right )} b f e + a x e^{2} + \frac {{\left (2 \, {\left (d x + c\right )} \operatorname {artanh}\left (d x + c\right ) + \log \left (-{\left (d x + c\right )}^{2} + 1\right )\right )} b e^{2}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 421 vs.
\(2 (119) = 238\).
time = 0.41, size = 421, normalized size = 3.51 \begin {gather*} \frac {2 \, a d^{3} f^{2} x^{3} + b d^{2} f^{2} x^{2} + 6 \, a d^{3} x \cosh \left (1\right )^{2} + 6 \, a d^{3} x \sinh \left (1\right )^{2} - 4 \, b c d f^{2} x + 6 \, {\left (a d^{3} f x^{2} + b d^{2} f x\right )} \cosh \left (1\right ) + {\left (3 \, {\left (b c + b\right )} d^{2} \cosh \left (1\right )^{2} + 3 \, {\left (b c + b\right )} d^{2} \sinh \left (1\right )^{2} - 3 \, {\left (b c^{2} + 2 \, b c + b\right )} d f \cosh \left (1\right ) + {\left (b c^{3} + 3 \, b c^{2} + 3 \, b c + b\right )} f^{2} + 3 \, {\left (2 \, {\left (b c + b\right )} d^{2} \cosh \left (1\right ) - {\left (b c^{2} + 2 \, b c + b\right )} d f\right )} \sinh \left (1\right )\right )} \log \left (d x + c + 1\right ) - {\left (3 \, {\left (b c - b\right )} d^{2} \cosh \left (1\right )^{2} + 3 \, {\left (b c - b\right )} d^{2} \sinh \left (1\right )^{2} - 3 \, {\left (b c^{2} - 2 \, b c + b\right )} d f \cosh \left (1\right ) + {\left (b c^{3} - 3 \, b c^{2} + 3 \, b c - b\right )} f^{2} + 3 \, {\left (2 \, {\left (b c - b\right )} d^{2} \cosh \left (1\right ) - {\left (b c^{2} - 2 \, b c + b\right )} d f\right )} \sinh \left (1\right )\right )} \log \left (d x + c - 1\right ) + {\left (b d^{3} f^{2} x^{3} + 3 \, b d^{3} f x^{2} \cosh \left (1\right ) + 3 \, b d^{3} x \cosh \left (1\right )^{2} + 3 \, b d^{3} x \sinh \left (1\right )^{2} + 3 \, {\left (b d^{3} f x^{2} + 2 \, b d^{3} x \cosh \left (1\right )\right )} \sinh \left (1\right )\right )} \log \left (-\frac {d x + c + 1}{d x + c - 1}\right ) + 6 \, {\left (a d^{3} f x^{2} + 2 \, a d^{3} x \cosh \left (1\right ) + b d^{2} f x\right )} \sinh \left (1\right )}{6 \, d^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 369 vs.
\(2 (105) = 210\).
time = 2.26, size = 369, normalized size = 3.08 \begin {gather*} \begin {cases} a e^{2} x + a e f x^{2} + \frac {a f^{2} x^{3}}{3} + \frac {b c^{3} f^{2} \operatorname {atanh}{\left (c + d x \right )}}{3 d^{3}} - \frac {b c^{2} e f \operatorname {atanh}{\left (c + d x \right )}}{d^{2}} + \frac {b c^{2} f^{2} \log {\left (\frac {c}{d} + x + \frac {1}{d} \right )}}{d^{3}} - \frac {b c^{2} f^{2} \operatorname {atanh}{\left (c + d x \right )}}{d^{3}} + \frac {b c e^{2} \operatorname {atanh}{\left (c + d x \right )}}{d} - \frac {2 b c e f \log {\left (\frac {c}{d} + x + \frac {1}{d} \right )}}{d^{2}} + \frac {2 b c e f \operatorname {atanh}{\left (c + d x \right )}}{d^{2}} - \frac {2 b c f^{2} x}{3 d^{2}} + \frac {b c f^{2} \operatorname {atanh}{\left (c + d x \right )}}{d^{3}} + b e^{2} x \operatorname {atanh}{\left (c + d x \right )} + b e f x^{2} \operatorname {atanh}{\left (c + d x \right )} + \frac {b f^{2} x^{3} \operatorname {atanh}{\left (c + d x \right )}}{3} + \frac {b e^{2} \log {\left (\frac {c}{d} + x + \frac {1}{d} \right )}}{d} - \frac {b e^{2} \operatorname {atanh}{\left (c + d x \right )}}{d} + \frac {b e f x}{d} + \frac {b f^{2} x^{2}}{6 d} - \frac {b e f \operatorname {atanh}{\left (c + d x \right )}}{d^{2}} + \frac {b f^{2} \log {\left (\frac {c}{d} + x + \frac {1}{d} \right )}}{3 d^{3}} - \frac {b f^{2} \operatorname {atanh}{\left (c + d x \right )}}{3 d^{3}} & \text {for}\: d \neq 0 \\\left (a + b \operatorname {atanh}{\left (c \right )}\right ) \left (e^{2} x + e f x^{2} + \frac {f^{2} x^{3}}{3}\right ) & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 976 vs.
\(2 (112) = 224\).
time = 0.43, size = 976, normalized size = 8.13 \begin {gather*} \frac {1}{6} \, {\left ({\left (c + 1\right )} d - {\left (c - 1\right )} d\right )} {\left (\frac {{\left (\frac {3 \, {\left (d x + c + 1\right )}^{2} b d^{2} e^{2}}{{\left (d x + c - 1\right )}^{2}} - \frac {6 \, {\left (d x + c + 1\right )} b d^{2} e^{2}}{d x + c - 1} + 3 \, b d^{2} e^{2} - \frac {6 \, {\left (d x + c + 1\right )}^{2} b c d e f}{{\left (d x + c - 1\right )}^{2}} + \frac {12 \, {\left (d x + c + 1\right )} b c d e f}{d x + c - 1} - 6 \, b c d e f + \frac {3 \, {\left (d x + c + 1\right )}^{2} b c^{2} f^{2}}{{\left (d x + c - 1\right )}^{2}} - \frac {6 \, {\left (d x + c + 1\right )} b c^{2} f^{2}}{d x + c - 1} + 3 \, b c^{2} f^{2} + \frac {6 \, {\left (d x + c + 1\right )}^{2} b d e f}{{\left (d x + c - 1\right )}^{2}} - \frac {6 \, {\left (d x + c + 1\right )} b d e f}{d x + c - 1} - \frac {6 \, {\left (d x + c + 1\right )}^{2} b c f^{2}}{{\left (d x + c - 1\right )}^{2}} + \frac {6 \, {\left (d x + c + 1\right )} b c f^{2}}{d x + c - 1} + \frac {3 \, {\left (d x + c + 1\right )}^{2} b f^{2}}{{\left (d x + c - 1\right )}^{2}} + b f^{2}\right )} \log \left (-\frac {d x + c + 1}{d x + c - 1}\right )}{\frac {{\left (d x + c + 1\right )}^{3} d^{4}}{{\left (d x + c - 1\right )}^{3}} - \frac {3 \, {\left (d x + c + 1\right )}^{2} d^{4}}{{\left (d x + c - 1\right )}^{2}} + \frac {3 \, {\left (d x + c + 1\right )} d^{4}}{d x + c - 1} - d^{4}} + \frac {2 \, {\left (\frac {3 \, {\left (d x + c + 1\right )}^{2} a d^{2} e^{2}}{{\left (d x + c - 1\right )}^{2}} - \frac {6 \, {\left (d x + c + 1\right )} a d^{2} e^{2}}{d x + c - 1} + 3 \, a d^{2} e^{2} - \frac {6 \, {\left (d x + c + 1\right )}^{2} a c d e f}{{\left (d x + c - 1\right )}^{2}} + \frac {12 \, {\left (d x + c + 1\right )} a c d e f}{d x + c - 1} - 6 \, a c d e f + \frac {3 \, {\left (d x + c + 1\right )}^{2} a c^{2} f^{2}}{{\left (d x + c - 1\right )}^{2}} - \frac {6 \, {\left (d x + c + 1\right )} a c^{2} f^{2}}{d x + c - 1} + 3 \, a c^{2} f^{2} + \frac {6 \, {\left (d x + c + 1\right )}^{2} a d e f}{{\left (d x + c - 1\right )}^{2}} - \frac {6 \, {\left (d x + c + 1\right )} a d e f}{d x + c - 1} + \frac {3 \, {\left (d x + c + 1\right )}^{2} b d e f}{{\left (d x + c - 1\right )}^{2}} - \frac {6 \, {\left (d x + c + 1\right )} b d e f}{d x + c - 1} + 3 \, b d e f - \frac {6 \, {\left (d x + c + 1\right )}^{2} a c f^{2}}{{\left (d x + c - 1\right )}^{2}} + \frac {6 \, {\left (d x + c + 1\right )} a c f^{2}}{d x + c - 1} - \frac {3 \, {\left (d x + c + 1\right )}^{2} b c f^{2}}{{\left (d x + c - 1\right )}^{2}} + \frac {6 \, {\left (d x + c + 1\right )} b c f^{2}}{d x + c - 1} - 3 \, b c f^{2} + \frac {3 \, {\left (d x + c + 1\right )}^{2} a f^{2}}{{\left (d x + c - 1\right )}^{2}} + a f^{2} + \frac {{\left (d x + c + 1\right )}^{2} b f^{2}}{{\left (d x + c - 1\right )}^{2}} - \frac {{\left (d x + c + 1\right )} b f^{2}}{d x + c - 1}\right )}}{\frac {{\left (d x + c + 1\right )}^{3} d^{4}}{{\left (d x + c - 1\right )}^{3}} - \frac {3 \, {\left (d x + c + 1\right )}^{2} d^{4}}{{\left (d x + c - 1\right )}^{2}} + \frac {3 \, {\left (d x + c + 1\right )} d^{4}}{d x + c - 1} - d^{4}} - \frac {{\left (3 \, b d^{2} e^{2} - 6 \, b c d e f + 3 \, b c^{2} f^{2} + b f^{2}\right )} \log \left (-\frac {d x + c + 1}{d x + c - 1} + 1\right )}{d^{4}} + \frac {{\left (3 \, b d^{2} e^{2} - 6 \, b c d e f + 3 \, b c^{2} f^{2} + b f^{2}\right )} \log \left (-\frac {d x + c + 1}{d x + c - 1}\right )}{d^{4}}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.39, size = 381, normalized size = 3.18 \begin {gather*} x^2\,\left (\frac {f\,\left (b\,f+6\,a\,c\,f+6\,a\,d\,e\right )}{6\,d}-\frac {a\,c\,f^2}{d}\right )-\ln \left (1-d\,x-c\right )\,\left (\frac {b\,e^2\,x}{2}+\frac {b\,e\,f\,x^2}{2}+\frac {b\,f^2\,x^3}{6}\right )-x\,\left (\frac {2\,c\,\left (\frac {f\,\left (b\,f+6\,a\,c\,f+6\,a\,d\,e\right )}{3\,d}-\frac {2\,a\,c\,f^2}{d}\right )}{d}-\frac {3\,a\,c^2\,f^2+12\,a\,c\,d\,e\,f+3\,a\,d^2\,e^2+3\,b\,d\,e\,f-3\,a\,f^2}{3\,d^2}+\frac {a\,f^2\,\left (3\,c^2-3\right )}{3\,d^2}\right )+\ln \left (c+d\,x+1\right )\,\left (\frac {b\,e^2\,x}{2}+\frac {b\,e\,f\,x^2}{2}+\frac {b\,f^2\,x^3}{6}\right )+\frac {a\,f^2\,x^3}{3}+\frac {\ln \left (c+d\,x-1\right )\,\left (\frac {b\,f^2}{6}+d\,\left (\frac {b\,e\,f\,c^2}{2}-b\,e\,f\,c+\frac {b\,e\,f}{2}\right )+d^2\,\left (\frac {b\,e^2}{2}-\frac {b\,c\,e^2}{2}\right )+\frac {b\,c^2\,f^2}{2}-\frac {b\,c^3\,f^2}{6}-\frac {b\,c\,f^2}{2}\right )}{d^3}+\frac {\ln \left (c+d\,x+1\right )\,\left (\frac {b\,f^2}{6}-d\,\left (\frac {b\,e\,f\,c^2}{2}+b\,e\,f\,c+\frac {b\,e\,f}{2}\right )+d^2\,\left (\frac {b\,e^2}{2}+\frac {b\,c\,e^2}{2}\right )+\frac {b\,c^2\,f^2}{2}+\frac {b\,c^3\,f^2}{6}+\frac {b\,c\,f^2}{2}\right )}{d^3} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________